package com.lagou.service;

import javax.servlet.http.HttpServletResponse;

public interface UserService {
    /**
     * 注册接口：-1后台服务异常 0.成功 1.验证码错误 2.验证码超时 3.未发送过验证码 4.邮箱已经注册
     * @param email
     * @param password
     * @param code
     * @param response
     * @return
     */
    String register(String email, String password, String code, HttpServletResponse response);

    /**
     * 判断邮箱是否已经注册,true代表已经注册过，false代表尚未注册
     * @param email
     * @return
     */
    boolean isRegistered(String email);

    /**
     * 根据token查询用户登录邮箱接口
     * @param token
     * @return
     */
    String info(String token);


    /**
     * 登录接口，成功返回0，错误返回1
     * @param email
     * @param password
     * @param response
     * @return
     */
    boolean login(String email, String password, HttpServletResponse response);
}
